package day6Exer;

/*
* 普通父类，Car
* */
public class Car {
    public static void main(String[] args) {

        SubCar subCar = new SubCar();

        subCar.changeSpeed(100);
    }

    //属性 品牌
    private String mark;

    //驾驶
    public void run(){
        System.out.println("开上我心爱的吉普车");
    }

    public String getMark() {
        return mark;
    }

    public void setMark(String mark) {
        this.mark = mark;
    }
}
class SubCar extends Car{
    //价格
    private double price;

    //速度
    private int speed;

    //在行驶过程中进行变速
    public void changeSpeed(int speed){
        this.speed = speed;

        //调用父类的驾驶方法
        run();

        System.out.println("当前速度为"+this.speed);

    }

}
